package com.example.test.controller;

import com.example.test.entity.Score;
import desktop.Desktop;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping(value = "/score")
public class ScoreController {

    @RequestMapping(value = "/setScore", method = RequestMethod.POST)
    private void setScore(@RequestBody Score score){
        Desktop.getInstance().setScore(score.getScreen(),score.getMatch(),score.isTeam(),score.getScore());
        System.out.println("裁判设置"+score.getScreen()+"赛道第"
                +score.getMatch()+"局比赛"+(score.isTeam()?"红":"黄")+"队比分："+score.getScore());
    }
}
